const express = require('express');
const router = express.Router();

router.get('/forCurrentUser', (req, res) => {
    const content = [];
    for(let i = 0; i < 40; i++) content.push({
        id: `${i + 1}`,
        technologyActivityCode: 'string',
        technologyActivityName: 'string',
        dealerCode: 'string',
        dealerName: 'string',
        country: 'string',
        status: 1,
        delayReason: 'string',
        deadlineTime: '2020-04-30T03:38:57.447Z',
        telephone: 'string',
        email: 'string',
        completionRate: 1,
        recommendedFullRate: 1,
        creatorTime: '2020-04-30T03:38:57.447Z',
        submitTime: '2020-04-30T03:38:57.447Z',
        approveTime: '2020-04-30T03:38:57.447Z',
        isError: true,
        rowVersion: 'string',
        options: [
            'update',
            'approve',
            'submit',
            'abandon',
        ]
    });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 41,
        }
    });
});
router.get('/:id', (req, res) => {
    res.json(
        {
            message: 'string',
            payload: {
                id: '1',
                brandId: 'string',
                brandCode: 'string',
                brandName: 'string',
                technologyActivityCode: 'string',
                technologyActivityName: 'string',
                telephone: 'string',
                email: 'string',
                completionRate: 1,
                delayReason: 'string',
                recommendedFullRate: 1,
                deadlineTime: '2020-04-30T03:38:57.447Z',
                directorOpinion: 'string',
                creatorTime: '2020-04-30T03:38:57.447Z',
                creatorName: 'string',
                submitTime: '2020-04-30T03:38:57.447Z',
                submitterName: 'string',
                approveTime: '2020-04-30T03:38:57.447Z',
                approveComment: 'string',
                approverName: 'string',
                isError: true,
                rowVersion: 'string',
                options: [
                    'update',
                    'approve',
                    'submit',
                    'abandon',
                ],
                approveDetails: [
                    {
                        id: '1',
                        approverName: 'string',
                        approveComment: 'string',
                        approvedResult: 1,
                        approveTime: '2020-04-30T03:38:57.447Z'
                    }
                ],
                attachments: [
                    {
                        fileId: 'fileId147',
                        fileName: 'fileName148'
                    },
                    {
                        fileId: 'fileId149',
                        fileName: 'fileName150'
                    }
                ],
            }
        }
    );
});

router.put('/:id', (req, res) => {
    res.json({
        message: '编辑成功'
    });
});
router.post('/', (req, res) => {
    res.json({
        message: '新增成功'
    });
});
router.put('/:id/abandon', (req, res) => {
    res.json({
        message: '作废成功'
    });
});
router.put('/:id/approvePass', (req, res) => {
    res.json({
        message: '审核通过'
    });
});
router.put('/:id/approveBack', (req, res) => {
    res.json({
        message: '审核驳回'
    });
});
router.put('/:id/approveReject', (req, res) => {
    res.json({
        message: '审核拒绝'
    });
});
router.get('/export/forCurrentUser', (req, res) => {
    res.json({
        message: '导出成功'
    });
});
module.exports = router;
